home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / doors / encrypt / encrypt.c next >
Encoding:
C/C++ Source or Header  |  1992-12-26  |  1.2 KB  |  63 lines

  1. #include <exec/exec.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "dh1:source/doors/romconf/doorheader.h"
  5. #define gu getuserstring
  6. long enc[100];
  7. void LastCommand(void);
  8. void end(void);
  9. main(int argc,char *argv[])
  10. {
  11.   char name[200];
  12.   char Date[200];
  13.   long thedate;
  14.   long total=0L;
  15.   FILE *fi;
  16.   register int i=0;
  17.   Register(argv[1][0]-'0');
  18.   gu(name,DT_NAME);
  19.   gu(Date,DT_CURR_TIME);
  20.   thedate=atol(Date);
  21.   while(name[i]!='\0')
  22.   {
  23.      enc[i]=thedate+(LONG)name[i];
  24.      total +=(LONG)name[i];
  25.      i++;
  26.   }
  27.   fi=fopen("CODE:Encrypt.h","w");
  28.   fprintf(fi,"long CheckSum = %ldL;\n",thedate);
  29.   fprintf(fi,"long CodeName[] = { ");
  30.   while(i)
  31.   {
  32.     fprintf(fi,"\t%ldL,\n",enc[i-1]);
  33.     i--;
  34.   }
  35.   fprintf(fi,"\t0L };\n");
  36.   fprintf(fi,"long CodeTotal = %ldL;\n",total);
  37.   strcpy(name,"/X Registered to ");
  38.   i=0;
  39.     while(name[i]!='\0')
  40.   {
  41.      enc[i]=thedate+(LONG)name[i];
  42.      total +=(LONG)name[i];
  43.      i++;
  44.   }
  45.     fprintf(fi,"long Legal[] = { ");
  46.   while(i)
  47.   {
  48.     fprintf(fi,"\t%ldL,\n",enc[i-1]);
  49.     i--;
  50.   }
  51.   fprintf(fi,"\t0L };\n");
  52.  
  53.   fclose(fi);
  54.   ShutDown();
  55.   end();
  56. }
  57. void LastCommand(void)
  58. {
  59. }
  60. void end(void)
  61. {
  62.   exit(0);
  63. }